# CMakeLists files in this project can
# refer to the root source directory of the project as ${HELLO_SOURCE_DIR} and
# to the root binary directory of the project as ${HELLO_BINARY_DIR}.
cmake_minimum_required(VERSION 3.1...3.26)
# This is your project statement. You should always list languages;
# Listing the version is nice here since it sets lots of useful variables
project(
  cpettemp
  VERSION 1.0
  LANGUAGES C)

file(GLOB SRCS "./*.c")

#SET(CMAKE_C_FLAGS "-Wno-missing-field-initializers -D_POSIX_C_SOURCE=200809L -Wextra ${CMAKE_C_FLAGS}")

if(MSVC)
set(CMAKE_C_FLAGS_DEBUG "/Od")
set(CMAKE_C_FLAGS_RELEASE "/Od")
else()
set(CMAKE_C_FLAGS_DEBUG "-g -O0")
set(CMAKE_C_FLAGS_RELEASE "-O0")
set(CMAKE_C_FLAGS_RELEASE "-msse -msse2")
endif()

set(a_src cpettemp.dll.c  cpettemp.def)
#set(CMAKE_DEBUG_POSTFIX _d)
set(CMAKE_li)
include_directories (.)
link_directories (./libs)
add_library (cpettemp SHARED  ${a_src})
if(MSVC)
    target_compile_options(cpettemp PRIVATE
        $<$<CONFIG:Debug>:/Zi>  # Generate debug info only for Debug configuration
    )
    target_link_options(cpettemp PRIVATE
        $<$<CONFIG:Debug>:/DEBUG:FULL>  # Link with full debug info only for Debug configuration
    )
endif()
target_link_libraries(cpettemp cpetsurvey.lib)

